﻿@using DLM.Services.Implementations;
@using DLM.Infrastructure.Configuration;
@{
    IEnumerable<DLM.Domain.DTO.BillBoard> list = PageDataService.BillboardList();
}
<!DOCTYPE html>
<html>
<head>
    <title>交友社区-同城活动-都来米都市交友社区首页</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/css/global.css")" rel="stylesheet" type="text/css" />
    <!--[if IE 6]><link href="../content/css/global_ie6.css" rel="stylesheet" type="text/css" /><![endif]-->
    <link type="text/css" href="@Url.Content("~/Content/themes/custom/jquery-ui-1.8.18.custom.css")" rel="stylesheet" />
    @*<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")"></script>*@
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui-1.8.18.custom.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.bgiframe.min.js")"></script>
    <!--[if IE 6]><script type="text/javascript" src="../scripts/pngfix.js"></script><![endif]-->
    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/dialog.js")" type="text/javascript"></script>
    <script type="text/javascript">
        //        $(document).ready(function () {
        //            $(".my_act dt").mouseover(function () {

        //                $(this).addClass("current");
        //            });
        //            $(".my_act dt").mouseout(function () {

        //                $(this).removeClass("current");
        //            });
        //        });

        function confirmed(id) {
            if (id != null) {
                $.ajax({
                    type: "POST",
                    url: "/User/ConfirmedMessage",
                    data: { id: id }
                }).done(function (msg) {

                });
            }
        }
    </script>
</head>
<body>
    @{var messageList = ViewData["MyMessage"] as IEnumerable<DLM.Domain.Model.Message>;
      var noticeList = ViewData["Notice"] as IEnumerable<DLM.Domain.Model.Notice>;
    }
    @if ((messageList != null && messageList.Count() > 0) || (noticeList != null && noticeList.Count() > 0))
    {

        <!--右下角弹出框-->

        <dl style="display: none;">
            <dd>style:
                <input type="radio" value="pink" name="style" id="pink" checked="checked" />
                <label for="pink">
                    pink</label>
                <input type="radio" value="blue" name="style" id="blue" />
                <label for="blue">
                    blue</label>
            </dd>
            <dd>showDeplay:
                <input type="text" value="2" readonly="readonly" />
            </dd>
            <dd>autoHide:
                <input type="text" id="txtAutoHide" value="30" />
                <input value="Set" type="button" id="btnSet" />
                <span id="info" style="color: #FF0000"></span>
            </dd>
            <dd>
                <input type="button" id="btnControl" value="Show" />
            </dd>
        </dl>

        <!--sheyMsg start-->

        <div class="msg pink" id="msgbox">
            <div class="top">
                <div class="title">
                    短消息
                </div>
                <span title="close" id="msgclose"></span>
            </div>
            <div class="center">
                <ul id="a_ul">
                    @if (messageList != null)
                    {
                        foreach (var item in ViewData["MyMessage"] as IEnumerable<DLM.Domain.Model.Message>)
                        {
                            switch (item.Source)
                            {
                                case "打招呼":
                        <li><a onclick="confirmed(@item.MessageID)" href="@Url.Action("Salutation", "Friend")">@item.Title</a></li>
                                    break;
                                case "好友":
                        <li><a  onclick="confirmed(@item.MessageID)" href="@Url.Action("List", "Friend")">@item.Title</a></li>
                                    break;
                                default:
                        <li><a href="@Url.Action("MessageCenter", "User")">@item.Title</a></li>
                                    break;
                            }

                        }

                    }
                    @if (noticeList != null)
                    {
                        foreach (var nItem in noticeList)
                        {
                        <li><a href="@Url.Action("MessageCenter", "User")">@nItem.Subject</a></li>
                        }
                    }
                </ul>
            </div>
        </div>

        <!--sheyMsg end-->



        <!--右下角弹出框end-->
       
    }
    <div id="MessageDialog" style="display: none;">
    </div>
    @Html.Partial("_LogOnPartial", new DLM.Domain.Model.Account())
    <div id="header">
        <div class="ad1">
            <div class="ad_custom">
                <a href="@Url.Action("Index", "Home")">
                    @{string path = ApplicationSettingsFactory.GetApplicationSettings().AdvPath;}
                    <img src="@Url.Content("~/" + path)" alt="广告" /></a>
            </div>
        </div>
        <!--<div class="menu"><ul class="first_ul"><li><a href="index.html">首页</a></li></ul></div>-->
        <div class="search_bar">
            @Html.Partial("_UserSearch")
        </div>
        <div class="bread">
            @Html.MvcSiteMap().SiteMapPath()
        </div>
    </div>
    <div id="content" class="clearfix">
        <div class="sidebar" id="index">
            @if (Request.IsAuthenticated)
            {
                <div class="box">
                    <div class="my_act">
                        <h5>我的社区</h5>
                        <dl>
                            <dt class="request_1"><a href="@Url.Action("List", "Friend")">好友请求</a><span> (@{var fCount = PageDataService.FriendInvitationCount(User.Identity.Name);}
                                @fCount )</span></dt>
                            <dt class="invite"><a href="@Url.Action("MyInvitation", "Party")">活动邀请</a><span> (@{var pCount = PageDataService.PartyInvitationCount(User.Identity.Name);}
                                @pCount )</span></dt>
                            <dt class="mycall"><a href="@Url.Action("Salutation", "Friend")">我的招呼</a><span> (@{var gCount = PageDataService.GreetInvitationCount(User.Identity.Name);}
                                @gCount )</span></dt>
                            <dt class="creatmeet"><a href="@Url.Action("Publish", "Party")">发布活动</a></dt>
                        </dl>
                    </div>
                </div>
            }
            @{Html.RenderPartial("_Show", list);}
            @if (ViewData["RecentParty"] != null)
            {
             
                <!--add朋友动向-最近参加的活动-->
                <div class="box">
                    <h6>
                        @{ 
                         
                int id = -1;
                if (ViewData["UserID"] != null)
                {
                    id = (int)ViewData["UserID"];
                }
                        }
                        <span class="more pngfix"><a href="@Url.Action("RecentParties", "User", new { id = id })">更多</a></span>他最近的活动</h6>
                    <div class="recently_meeting">
                        <ul class="clearfix">
                            @foreach (var item in ViewData["RecentParty"] as IEnumerable<DLM.Domain.DTO.PartyDTO>)
                            {
                                <li>
                                    <div class="img">
                                        <a href="@Url.Action("View", "Party", new { id = item.PartyID })">
                                            @if (item.PublisherPhoto == "none_75_75.png")
                                            {
                                                <img src="@Url.Content("~/Content/ad/none_75_75.png")" alt="头像" height="90px" width="77px"/>
                                            }
                                            else
                                            { 
                                                <img width="77px" height="90px" src="@Url.Content("~/Files/Photos/" + item.UserID + "/" + item.PublisherPhoto)" alt="user pic" />
                                            }
                                        </a>
                                    </div>
                                    <div class="info">
                                        <h5>
                                            <a href="@Url.Action("View", "Party", new { id = item.PartyID })">@item.Subject</a></h5>
                                    </div>
                                </li>
                            }
                        </ul>
                    </div>
                </div>
                <!--朋友动向end-->
            }
        </div>
        @RenderBody()
    </div>
        <div class="friend_link">
        <h1>友情链接</h1>
        <ul>
            <li><a href="http://www.wifiduoduo.com">宽带出租精灵
              @*  <img src="upload/logo.gif" />*@</a></li>
        </ul>
    </div>
    @Html.Action("Footer", "Home")
    <script type="text/javascript" src="@Url.Content("~/Scripts/ui.js")"></script>
    @if ((messageList != null && messageList.Count() > 0) || (noticeList != null && noticeList.Count() > 0))
    {
        <script type="text/javascript" src="@Url.Content("~/Scripts/message.js")"></script>
        <script type="text/javascript">
            var g = function (id) { return document.getElementById(id) };
            var msg = new sheyMsg("msgbox", {
                showDelay: 2, //
                onHide: function () {
                    btn.value = "Show";
                },
                onShow: function () {
                    btn.value = "Hide";
                }
            });

            g("pink").onclick = g("blue").onclick = function () {//switch style
                g("msgbox").className = "msg " + this.value;
            }
            var btn = g("btnControl");
            btn.onclick = function () {//show or hide
                if (this.value == "Show")
                    msg.show();
                else
                    msg.hide();
            }
            g("btnSet").onclick = function () {//set autoHide
                var v = g("txtAutoHide").value;
                if (!isNaN(v)) {
                    msg.options.autoHide = v - 0;
                    g("info").innerHTML = "隐藏时间已设置,下一次show时生效";
                    setTimeout("g('info').innerHTML='';", 3000);
                }
            }
            g("msgclose").onclick = function () {//hide
                msg.hide();
            }

        </script>

  
    }
</body>
</html>
